package org.example.commerce.dao.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import java.math.BigDecimal;
import java.util.Date;
import java.io.Serializable;

/**
 * (Good)实体类
 *
 * @author makejava
 * @since 2022-11-17 09:45:38
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
@Table(name = "tab_goods")
public class Goods implements Serializable {
    /**
     * 商品id
     */
    @Id
    @GeneratedValue(generator = "JDBC")
    private Long id;
    /**
     * 商品名称
     */
    private String name;
    /**
     * 商品价格
     */
    private BigDecimal price;
    /**
     * 上架时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    private Date createTime;
    /**
     * 商品图片
     */
    private String imgUrl;
    /**
     * 商品分类编号
     */
    private Long categoryId;

}